package org.crate.query.api;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;

/**
 * Created by huangfei on 2018/9/21.
 */
public class CreateTables {

    public static void main(String[] args) throws IOException, SQLException {

        CrateQueryApi crateQueryApi = new CrateQueryApi(null);
        File dir = new File("C:\\Users\\huangfei\\Desktop\\crate_table");
        File[] files = dir.listFiles();

        for(File file : files){
            String sql = FileUtils.readFileToString(file,"UTF-8");
            System.out.println(crateQueryApi.execute(sql));
        }
    }

}
